var stdin = process.stdin;

stdin.on("data",function(){
    var chunk = chunk.toString("utf8");
    var result = chunk.slice(0,-2);
    if(result==""){
        stdin.emit("end");
    }
});

stdin.on("end",function(){
    console.log("stdin ended");
})